{% extends "base.html" %}
{% block title %}正在播放 - {{ file_path[0:-4] }}{% endblock %}
{% block page_content %}
    <div class="header"></div>
    <div class="content">
        <h1>视频播放器</h1>
        <p align="center">{{ file_path }}</p>
        <div class="middleBox">
            <div id="dplayer"></div>
        </div>
        <div class="rightBox">
            <h2>播放列表</h2>
            <div class="videoListBox">
                <table class="tableBox" align="center" border="1" cellpadding="10">
                    {% for filename in videolist %}
                        <tr align=left>
                            <td>
                                <a href="{{ url_for('play', file_path=(path+filename).replace('/','&') ) }}">{{ filename }}</a>
                            </td>
                        </tr>
                    {% endfor %}
                </table>
            </div>
        </div>

    </div>
    <a href="{{ url_for('static', filename='file/' + file_path ) }} " download="">下载此视频</a>
    {% include "endBox.html" %}
    <link rel="stylesheet" href="{{ url_for('static', filename='DPlayer.min.css')}}">
    <script src="/static/flv.min.js"></script>
    <script src="/static/hls.min.js"></script>
    <script src="/static/DPlayer.min.js"></script>
    <script>
        const dp = new DPlayer({
            container: document.getElementById('dplayer'),

            video: {
                url: '{{ url_for('static', filename='file/' + file_path ) }}',
            }
        });

    </script>

{% endblock %}

